#define _GNU_SOURCE
#include "app_pool.h"
#include "log/log.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int task_func(void *arg)
{
    char *data = (char *)arg;
    log_debug("任务函数在分线程(%d)执行处理, data=%s", gettid(), data);
}

int main(int argc, char const *argv[])
{
    app_pool_init(5);
    for (int i = 0; i < 10; i++)
    {
        char *data = malloc(10);
        sprintf(data, "abc_%d", i);
        app_pool_registerTask(task_func, data);
    }
    sleep(1);
    app_pool_destroy();
    return 0;
}
